home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / tcp / wu_ftpd_37_21.lha / wu-ftpd / src / hostacc.h < prev    next >
C/C++ Source or Header  |  1994-04-13  |  2KB  |  70 lines

  1. /*
  2.  *  @(#) hostacc.h  -   Header file used in the implementation of
  3.  *              host access for the experimental FTP daemon
  4.  *              developed at Washington University.
  5.  *
  6.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  7.  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  8.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  9.  *
  10.  * AUTHOR
  11.  *  Bart Muijzer    <bartm@cv.ruu.nl>
  12.  *
  13.  * HISTORY
  14.  *  930316  BM  Created
  15.  *  930317  BM  Cleanups, better readability
  16.  */
  17.  
  18. #ifdef  HOST_ACCESS
  19.  
  20. #include <stdio.h>
  21. #ifdef SYSSYSLOG
  22. #include <sys/syslog.h>
  23. #else
  24. #include <syslog.h>
  25. #endif
  26. #include <string.h>
  27. #include <stdlib.h>
  28. #include <errno.h>
  29.  
  30. #include "pathnames.h"          /* From the ftpd sources    */
  31.  
  32. /*
  33.  * Host Access types, as stored in the ha_type field, 
  34.  * and some other constants. All of this is tunable as
  35.  * long as you don't depend on the values.
  36.  */
  37.  
  38. #define ALLOW   1
  39. #define DENY    2
  40.  
  41. #define MAXLEN  1024    /* Maximum length of one line in config file */
  42. #define MAXLIN  100     /* Max. number of non-comment and non-empty  */
  43.                         /* lines in config file                      */
  44. #define MAXHST  10      /* Max. number of hosts allowed on one line  */
  45.  
  46. /* ------------------------------------------------------------------------- */
  47.  
  48. /*
  49.  * Structure holding all host-access information 
  50.  */
  51.  
  52. typedef struct  {
  53.     short   ha_type;            /* ALLOW | DENY             */
  54.     char    *ha_login;          /* Loginname to investigate */
  55.     char    *ha_hosts[MAXHST];  /* Array of hostnames       */
  56. } hacc_t;
  57.  
  58. /* ------------------------------------------------------------------------ */
  59.  
  60. int rhost_ok();
  61.  
  62. static  int sethacc(),
  63.         endhacc();
  64. static  hacc_t  *gethacc();
  65.  
  66. static  char    *strnsav();
  67. static  void    fatal();
  68.  
  69. #endif  /* HOST_ACCESS */
  70.